
import inspect
from django.contrib import admin
from . import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission

for attr in dir(models):
    model = getattr(models, attr)
    if not inspect.isclass(model):
        continue

    try:
        admin.site.register(model, admin.ModelAdmin)
    except Exception as _:  # noqa
        pass
admin.site.register(ContentType, admin.ModelAdmin)
admin.site.register(Permission, admin.ModelAdmin)
